package com.danger.Activity;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private Button primary_color_button;
    private Button color_matrix_button;
    private Button pixels_effect_button;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        initView();
        initEvent();

    }

    private void initView() {
        primary_color_button = (Button) findViewById(R.id.primary_color_button);
        color_matrix_button = (Button) findViewById(R.id.color_matrix_button);
        pixels_effect_button = (Button) findViewById(R.id.pixels_effect_button);
    }

    private void initEvent() {
        primary_color_button.setOnClickListener(this);
        color_matrix_button.setOnClickListener(this);
        pixels_effect_button.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.primary_color_button:
                startActivity(new Intent(MainActivity.this, PrimaryColorActivity.class));
                break;
            case R.id.color_matrix_button:
                startActivity(new Intent(MainActivity.this, ColorMatricActivity.class));
                break;
            case R.id.pixels_effect_button:
                startActivity(new Intent(MainActivity.this, PixelsEffectActivity.class));
                break;
            default:
                break;
        }
    }
}
